﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class UtilitiesDistrict : District
{
    public UtilitiesDistrict(City city)
        : base(DistrictType.Utilities, city)
    {
    }

    protected override bool IsCompleteDistrict(Dictionary<Building.BuildingType, int> typesInDistrict)
    {
        bool hasWater = typesInDistrict.ContainsKey(Building.BuildingType.WaterPlant);
        bool hasPower = typesInDistrict.ContainsKey(Building.BuildingType.PowerStation) || typesInDistrict.ContainsKey(Building.BuildingType.GreenPower);
        bool hasCommunications = typesInDistrict.ContainsKey(Building.BuildingType.FireStation);
        bool hasWaste = typesInDistrict.ContainsKey(Building.BuildingType.Capital);

        return hasWater && hasPower && hasCommunications && hasWaste;
    }

    protected override bool IsValidBuildingType(Building.BuildingType buildingType)
    {
        if (buildingType == Building.BuildingType.WaterPlant) return true;
        if (buildingType == Building.BuildingType.PowerStation) return true;
        if (buildingType == Building.BuildingType.GreenPower) return true;
        if (buildingType == Building.BuildingType.Communications) return true;
        if (buildingType == Building.BuildingType.Waste) return true;

        return false;
    }

    protected override float GetDistrictScore(List<Building> buildings)
    {
        return 20;
    }
}
